
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${base}/include/css/index.css" rel="stylesheet" type="text/css"> 
<script type='text/javascript'>
var CONTEXTPATH = '${base}';
</script>
<script type='text/javascript' src='${base}/include/js/main.js'></script> 
<title>$!app_name</title>

<script type="text/javascript">
 
this.CheckUserName=function()
{
	 
    if ($('#loginname').val() != "") {
        if ($('#password').val() != "") { 
            if ($('#verifcode').val().length==4) {
            	jQuery.ajax({
        			url : "${base}/private/doLogin",
        			data : jQuery("#form1").serialize(),
					type:"POST",
        			success : function (res) {
        				if (res == "true") {
        					window.location.href="${base}/private/index";
        				} else {
        					Dialog.alert(res);
        					$('#verifcode').val("");
        					tochange();
        				}
        				return false;
        			},
        			fail : function(res) {
        				Dialog.alert("系统错误?!");
        			}
        		});
            } else {
                Dialog.alert("请输入四位验证码！");
                
                $('#verifcode').focus();
                return false;
            }
        } else {
            Dialog.alert("密码不能为空！");
            $('#password').focus();
            return false;
        }

    } else {
        Dialog.alert("用户名不能为空！");
        $('#loginname').focus();
        return false;
    }

}
this.tochange=function()
{
    $("#validataimg").attr("src","${base}/codeimg?rnd=" + new Date().getTime());
} 
$(document).ready(function(){
	$(document).bind("keypress", "return", function (ev) { 
		  CheckUserName(); 
		});
	$("#img").click(CheckUserName);
});
</script>
</head>
<body style="overflow:hidden;">
	<form method="post" id="form1" name="form1" onsubmit="CheckUserName();return false;"
		style="display: block; height: 100%;">
		<table width="100%" height="100%" class="loginMain">
			<tr>
				<td align="center" valign="top">
					<table>
						<tr>
							<td align="center" valign="middle">
								<div style="height: 150px; width: 620px;"></div>
								<div
									style="height: 70px; width: 620px; margin: 0px auto 0px auto;">
									<table width="615" border="0" align="center" cellpadding="0"
										cellspacing="0">
										<tr>
											<td><img src="${base}/images/private/login_01.jpg"
												width="615" height="214"></td>
										</tr>
										<tr>
											<td height="73" valign="top"
												background="${base}/images/private/login_02.jpg">
												<table width="95%" border="0" align="center" cellpadding="0"
													cellspacing="0">
													<tr>
														<td height="35">用户名：</td>
														<td><input class="inputText" style="width: 80px"
															name="loginname" id="loginname" type="text"
															value="superadmin" onfocus="this.select();" /></td>
														<td>密码：</td>
														<td><input class="inputText" style="width: 80px"
															name="password" id="password" type="password" value="11"
															onfocus="this.select();" /></td>
														<td>验证码：</td>
														<td><img src="${base}/codeimg" name="validataimg"
															id="validataimg" title="点击刷新验证码" align="middle"
															onclick="tochange()" style="cursor: pointer" />&nbsp; <input
															class="inputText" maxlength="4" style="width: 60px"
															name="verifcode" id="verifcode" type="text" value=""
															onfocus="this.select();" /></td>
														<td><img id="img" src="${base}/images/private/login_icon.jpg"
															 style="cursor: pointer" /></td>
													</tr>
												</table>
												<table width="95%" border="0" align="center" cellpadding="0"
													cellspacing="0">
													<tr>
														<td height="26" align="center" class="eng">Copyright
															&copy; 2013 </td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</div>
							</td>
						</tr>
					</table>  

				</td>
			</tr>
		</table>
	</form>


</body>
</html>
